﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model
{
    /// <summary>
    /// 客户信息实体类
    /// </summary>
    public class Customer
    {
        public string CustomerID { get; set; }  //客户编号
        public string CustomerName { get; set; }//客户
        public Contact ContactInfo { get; set; }//联系方式
        public Customer() { }
        public Customer(string customerID,string customerName)
        {
            this.CustomerID   = customerID;
            this.CustomerName = customerName;
        }
        public Customer(Customer c, Contact bo = null)//关联类
        {
            this.CustomerID = c.CustomerID;
            this.CustomerName = c.CustomerName;
            if (bo != null)
            {
                this.ContactInfo = new Contact();
                this.ContactInfo.SpellingCode = bo.SpellingCode;
                this.ContactInfo.Address = bo.Address;
                this.ContactInfo.ZipCode = bo.ZipCode;
                this.ContactInfo.Tel = bo.Tel;
                this.ContactInfo.Fax = bo.Fax;
                this.ContactInfo.BankName = bo.BankName;
                this.ContactInfo.BankAccount = bo.BankAccount;
                this.ContactInfo.Contacter = bo.Contacter;
                this.ContactInfo.Email = bo.Email;
            }
        }
    }
}
